package com.ruowei.modules.foodOrder.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;

import java.io.Serializable;

/**
 * 商品sku、选项关系表
 */
@ApiModel(description = "商品sku、选项关系表")
@Entity
@Table(name = "sku_options_relationship")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class SkuOptionsRelationship implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * sku编码
     */
    @ApiModelProperty(value = "sku编码")
    @Column(name = "sku_code")
    private String skuCode;

    /**
     * 选项编码
     */
    @ApiModelProperty(value = "选项编码")
    @Column(name = "option_code")
    private String optionCode;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSkuCode() {
        return skuCode;
    }

    public SkuOptionsRelationship skuCode(String skuCode) {
        this.skuCode = skuCode;
        return this;
    }

    public void setSkuCode(String skuCode) {
        this.skuCode = skuCode;
    }

    public String getOptionCode() {
        return optionCode;
    }

    public SkuOptionsRelationship optionCode(String optionCode) {
        this.optionCode = optionCode;
        return this;
    }

    public void setOptionCode(String optionCode) {
        this.optionCode = optionCode;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof SkuOptionsRelationship)) {
            return false;
        }
        return id != null && id.equals(((SkuOptionsRelationship) o).id);
    }

    @Override
    public int hashCode() {
        return 31;
    }

    @Override
    public String toString() {
        return "SkuOptionsRelationship{" +
            "id=" + getId() +
            ", skuCode='" + getSkuCode() + "'" +
            ", optionCode='" + getOptionCode() + "'" +
            "}";
    }
}
